<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let a = 1;//全局
        /**1.全局作用域 window
         * 2.局部作用域 函数
         * 
         */

        {
            //  代码片段 块级作用域
            let a = 2;
            var b = 3;
            const name = 'Cavan';
            console.log(name);
            //冒泡查找，逐级往外
        }
        console.log(name, a, b);


    </script>

</body>

</html>